<?php

class serie extends Model {
	private $_Country1;
	private $_Country2;
	private $_Place;
	private $_Result;
	private $_Surface;
	private $_Matches;
	
	public function __construct($arrInitialValues = null){
		$this->setTable('serie');
		$this->setColumnId('serie_id');

		$this->_setDefaultValues($arrInitialValues);
		parent::__construct($arrInitialValues);
	}
	
	private function _setDefaultValues($arrInitialValues = null){
		if (isset($arrInitialValues['country1']) && !empty($arrInitialValues['country1']))
			$this->setCountry1(new Country(array ("id" => $arrInitialValues['country1'])));
		else 
			$this->setCountry1(new Country());

		if (isset($arrInitialValues['country2']) && !empty($arrInitialValues['country2']))
			$this->setCountry2(new Country(array ("id" => $arrInitialValues['country2'])));
		else 
			$this->setCountry2(new Country());
			
		if (isset($arrInitialValues['place']) && !empty($arrInitialValues['place']))
			$this->setPlace($arrInitialValues['place']);
		else 
			$this->setPlace('');
			
		if (isset($arrInitialValues['result']) && !empty($arrInitialValues['result']))
			$this->setResult($arrInitialValues['result']);
		else 
			$this->setResult('');
			
		if (isset($arrInitialValues['surface']) && !empty($arrInitialValues['surface']))
			$this->setSurface($arrInitialValues['surface']);
		else 
			$this->setSurface('');
			
		if (isset($arrInitialValues['matches']) && !empty($arrInitialValues['matches']))
			$this->setMatches($arrInitialValues['matches']);
		else 
			$this->setMatches('');
	}
	
	/**
	 * @return the $_Country1
	 */
	public function getCountry1() {
		return $this->_Country1;
	}

	/**
	 * @return the $_Country2
	 */
	public function getCountry2() {
		return $this->_Country2;
	}

	public function getMatches() {
		return $this->_Matches;
	}
	
	public function setMatches($value) {
		$this->_Matches = $value;
	}
	
	/**
	 * @return the $_Place
	 */
	public function getPlace() {
		return $this->_Place;
	}

	/**
	 * @return the $_Result
	 */
	public function getResult() {
		return $this->_Result;
	}

	/**
	 * @return the $_Surface
	 */
	public function getSurface() {
		return $this->_Surface;
	}

	/**
	 * @param field_type $_Country1
	 */
	public function setCountry1($_Country1) {
		$this->_Country1 = $_Country1;
	}

	/**
	 * @param field_type $_Country2
	 */
	public function setCountry2($_Country2) {
		$this->_Country2 = $_Country2;
	}

	/**
	 * @param field_type $_Place
	 */
	public function setPlace($_Place) {
		$this->_Place = $_Place;
	}

	/**
	 * @param field_type $_Result
	 */
	public function setResult($_Result) {
		$this->_Result = $_Result;
	}

	/**
	 * @param field_type $_Surface
	 */
	public function setSurface($_Surface) {
		$this->_Surface = $_Surface;
	}

}

?>